<include file="Public/siteTopbar" />
<script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/slider.js"></script>
<include file="Public/header" />
<script src="__PUBLIC__/js/layer/layer.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->


<div class="container usercenter" >

    <include file="User/menu" />

    <div class="col-sm-9">
        <div class="he50 wddd"> <div class="page-title">
                <h1 style="float:left;">Address Book</h1>
                
                <button type="button" title="Add New Address" class="button" onClick="address_edit({$list['address_id']})" style="float:right;"><span><span>Add New Address</span></span></button>
                
                
            </div>
           
        </div>

        <div class="wddd-js ov-in">
        
        
        <table class="data-table" id="my-orders-table">
    <colgroup>
    <col>
    <col>
    <col>
    <col width="1">
    </colgroup><thead>
        <tr class="first last">
            <th>Name</th>
            <th>Email Address</th>
            <th>Country</th>
           
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tbody>
     <volist name="lists" id="list">
        <tr class="first odd" >
            <td>{$list.consignee} {$list.lastname}</td>
            <td>{$list.email}</td>
            <td><span class="nobr">{$list.address}</span></td>
            
            <td class="a-center last">
            
                	<span class="nobr"><a href="javascript:address_edit({$list['address_id']})">Edit</a> | 
               
            	
                	<span class="nobr"><a href="{:U('Home/User/del_address',array('id'=>$list['address_id']))}">Delete</a> 
               
            </td>
        </tr>
        
        </volist>
            
            </tbody>
</table>
        
        </div>
    </div>
</div>
<div class="he80"></div>
<!--------footer-开始-------------->
<include file="Public/footer" />
<!--------footer-结束-------------->


</body>
<script>
    /*$(function () {
     $("#h-s").click(function () {
     $('.ec-ta-x').css('left','124px');
     $('.ec-ta-x').css('width','110px');
     $(this).addClass("cullent");
     $('#q-s').removeClass("cullent");
     });
     });
     */
</script>

<script>
    $(function () {
        $(function () {
            $("#q-s").mouseover(function () {
                $('.ec-ta-x').css('left','0px');
                $(this).addClass("cullent");
            });
            $("#q-s").mouseout(function () {
                $('.ec-ta-x').css('left','0px');
            });
        });
        $("#h-s").mouseover(function () {
            $('.ec-ta-x').css('left','82px');
            $(this).addClass("cullent");
        });
        $("#h-s").mouseout(function () {
            $('.ec-ta-x').css('left','0px');
            $(this).removeClass("cullent");
        });
    });

    $(function () {
        $("#j-s").mouseover(function () {
            $('.ec-ta-x').css('left','164px');
            $(this).addClass("cullent");
        });
        $("#j-s").mouseout(function () {
            $('.ec-ta-x').css('left','0px');
            $(this).removeClass("cullent");
        });
    });
    /**
     * 新增修改收货地址
     * id 为零 则为新增, 否则是修改
     *  使用 公共的 layer 弹窗插件  参考官方手册 http://layer.layui.com/
     */
    function address_edit(id)
    {
        if(id > 0)
            var url = "/index.php?m=Home&c=User&a=edit_address&scene=1&call_back=call_back_fun&id="+id; // 修改地址  '/index.php/Home/User/add_address/scene/1/call_back/call_back_fun/id/id' //iframe的url /index.php/Home/User/add_address
        else
            var url = "/index.php?m=Home&c=User&a=add_address&scene=1&call_back=call_back_fun";	// 新增地址
        layer.open({
            type: 2,
            title: 'Address Book',
            shadeClose: true,
            shade: 0.8,
            area: ['880px', '530px'],
            content: url,
        });
    }
    // 添加修改收货地址回调函数
    function call_back_fun(v){
        layer.closeAll(); // 关闭窗口
        location.href = location.href;
    }
</script>
</html>